<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script type="text/javascript" src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/vue/2.6.14/vue.min.js"></script>
    <title>等宽瀑布流-css</title>
    <style>
      /* css 方式 */
      .waterfall-width-column {
        column-count: 5;
        column-gap: 10px;
      }
      .image-box img {
        display: block;
        width: 100%;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <div class="waterfall-width-column">
        <div class="image-box" v-for="img in imgList" :key="img">
          <img :src="img" alt="" />
        </div>
      </div>
    </div>
    <script>
      new Vue({
        el: '#app',
        data() {
          return {
            colNumbers: 0,
            colWidth: 200,
            imgList: []
          }
        },
        created() {
          for (let i = 0; i < 17; i++) {
            this.imgList.push(`http://www.ruanyifeng.com/images_pub/pub_${i + 1}.jpg`)
          }
        }
      })
    </script>
  </body>
</html>
